﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PollInputModels>" %>

<%@ Import Namespace="SDT.Lib.Helpers" %>
<%@ Import Namespace="SDT.Admin.ViewModels" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Chi tiết Polls
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <%if (ViewData["MessageInfo"] == null)
      { %>
    <table class="admintable" width="100%">
        <tbody>
            <tr>
                <td class="key">
                    Menu
                </td>
                <td>
                    <ul>
                        <% if (Model.ListMenus != null && Model.ListMenus.Count() > 0)
                           {
                               foreach (var m in Model.ListMenus)
                               { 
                        %>
                        <li>
                            <%= m.Name %></li>
                        <%}
                       }%>
                    </ul>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Nội dung
                </td>
                <td>
                    <%= Model.Poll.PollContent %>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Trả lời
                </td>
                <td>
                    <ul>
                        <% if (Model.PollCases != null && Model.PollCases.Count() > 0)
                           {
                               foreach (var pc in Model.PollCases)
                               { %>
                               <li><%= pc.PollCase1 %> ( <%= pc.nVotes %> )</li>
                        <%}
                           }%>
                    </ul>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Ngày bắt đầu
                </td>
                <td>
                    <%= Model.Poll.PollFrom%>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Ngày kết thúc
                </td>
                <td>
                    <%= Model.Poll.PollTo %>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Ngày đăng
                </td>
                <td>
                    <%= Model.Poll.AddDate %>
                </td>
            </tr>
            <tr>
                <td class="key">
                    Trạng thái hiển thị
                </td>
                <td>
                    <%= Html.RadioButtonFor(m=>m.Poll.PubYN, true, Model.Poll.PubYN)%>
                    Đăng tin
                    <%= Html.RadioButtonFor(m => m.Poll.PubYN, true, !Model.Poll.PubYN)%>
                    Không đăng
                </td>
            </tr>
        </tbody>
    </table>
    <%} %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Toolbar" runat="server">
    <td>
        <%= Html.Toolbar("Sửa", "/Polls/Edit/" + Model.ID, "edit")%>
    </td>
    <td>
        <%= Html.Toolbar("Xoá", "/Polls/Delete/" + Model.ID, "delete")%>
    </td>
    <td>
        <%= Html.Toolbar("Quay về", "/Polls", "back")%>
    </td>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="Header" runat="server">
    Chi tiết Polls
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="Message" runat="server">
    <%=ViewData["MessageInfo"]!=null? "<p class='perror'>"+Html.Encode(ViewData["MessageInfo"])+"</p>":string.Empty%>
</asp:Content>
